package com.victor.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.victor.entity.collection.CollectionFolder;
import com.victor.entity.collection.Collections;

@Mapper
public interface CollectionfolderDao {
	/**
	 * 添加文件夹
	 * @param collectionFolder
	 * @return
	 */
	boolean insertCollectionFolder(CollectionFolder collectionFolder);
	/**
	 * 删除文件夹
	 * @param ids
	 * @return
	 */
	boolean delCollectionFolder(int[] ids);
	/**
	 * 查询文件夹
	 * @param uid
	 * @return
	 */
	List<CollectionFolder> selAllFolder(String uid);
	/**
	 * 根据文件夹idchaxun
	 * @param fid
	 * @return
	 */
	@Select({"select * from collections where fid=#{fid}"})
	List<Collections> selCollectionsByFid(Integer fid);
	/**
	 * 根据表名 和 对用id 查询
	 * @param pid
	 * @param table_name
	 * @return
	 */
	@Select({"select * from ${table_name} where ${pid}"})
	Map<Object, Object> selByTablenameAndPid(@Param("pid")String pid,@Param("table_name") String table_name);
	/**
	 * 修改文件夹
	 * @param folder
	 * @return
	 */
	boolean updateFolder(CollectionFolder folder);

}
